/*
 * Main.fx
 *
 * Created on 2009-04-05, 13:45:55
 */

package msquirrel;

import java.lang.System;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.scene.Group;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import msquirrel.Login;

/**
 * @author Krzysztof Wieczorek
 */

// Wysokość i szerokość okienka aplikacji
def stageWidth = 400;
def stageHeight = 300;

var firstStage:Stage;

Timeline {
    keyFrames:[
        KeyFrame { time: 0s action: function() { System.out.println("Start"); } },
        KeyFrame { time: 4s action: function() { System.out.println("Stop"); firstStage.close(); } },
    ]
    repeatCount: 1
}.play();

firstStage = Stage {
    title: "mSquirrel v0.1 - Notatki Wideo"
    width: stageWidth
    height: stageHeight
    visible: true
    style: StageStyle.UNDECORATED
    resizable: false
    onClose: function() { System.out.println("Exit"); var myStage:Stage = new Login().getLoginStage(); }

    scene: Scene {
        content: Group {
            content: [
                ImageView {
                    x:0
                    y:0
                    image: Image {
                        url: "{__DIR__}logo.jpg"
                    }
                }
            ]
        }
    }
}